import React from "react";
import PropTypes from "prop-types";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";

const BottomBtn = ({ title, onBtnClick, icon, btnCls }) => {
  return (
    <button
      type="button"
      className={`btn btn-block no-border ${btnCls}`}
      onClick={onBtnClick}
    >
      <FontAwesomeIcon title={title} icon={icon} className="mr-2" />
      {title}
    </button>
  );
};

BottomBtn.propTypes = {
  title: PropTypes.string,
  onBtnClick: PropTypes.func,
  icon: PropTypes.object.isRequired,
  btnCls: PropTypes.string,
};

BottomBtn.defaultProps = {
  title: "新建",
};

export default BottomBtn;
